package com.ruoyi.caigou.api;

import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.api.domain.caigou.BuyBackOrder;
import com.ruoyi.system.api.domain.caigou.BuyBackOrderDetail;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author wangenhao
 * @interfaceName RemoteBuyBackOrderService
 * @description 采购退货远程服务接口
 * @date 2024-11-07 上午11:44
 */
@FeignClient(contextId = "remoteBuyBackOrderService", value = ServiceNameConstants.CAIGOU_SERVICE)
public interface RemoteBuyBackOrderService {

    @PostMapping("/buyBackOrder/updateBuyBackOrderStatus")
    public AjaxResult updateBuyBackOrderStatus(@RequestBody BuyBackOrder buyBackOrder);

    /**
     * @return com.ruoyi.common.core.web.domain.AjaxResult
     * @description 获取所有采购退货单
     * @date 2024/11/9 上午11:05
     **/
    @GetMapping("/buyBackOrder/listAll")
    public AjaxResult listAll();

    /**
     * @return com.ruoyi.common.core.web.domain.AjaxResult
     * @description 根据采购退货编号获取采购退货详情
     * @date 2024/11/9 上午10:33
     * @Param buyBackOrderCode:
     **/
    @GetMapping("/buyBackOrder/info/buyBackOrderCode/{buyBackOrderCode}")
    public R<BuyBackOrder> getInfoByBuyBackOrderCode(@PathVariable("buyBackOrderCode") String buyBackOrderCode);

    /**
     * @return com.ruoyi.common.core.web.domain.AjaxResult
     * @description 修改采购退货详情
     * @date 2024/11/9 上午10:31
     * @Param buyBackOrderDetail:
     **/
    @PostMapping("/buyBackOrder/update/buyBackOrderDetail")
    public AjaxResult updateBuyBackOrderDetail(@RequestBody BuyBackOrderDetail buyBackOrderDetail);

    /**
     * @return com.ruoyi.common.core.web.domain.AjaxResult
     * @description 修改采购退货单
     * @date 2024/11/9 上午10:32
     * @Param buyBackOrder:
     **/
    @PutMapping("/buyBackOrder")
    public AjaxResult edit(@RequestBody BuyBackOrder buyBackOrder);

    /**
     * @return com.ruoyi.common.core.web.domain.AjaxResult
     * @description 财务收款单审核通过后修改状态
     * @date 2024/11/12 上午11:32
     * @Param buyBackOrder:
     **/
    @PostMapping("/buyBackOrder/update/afterAuditReciveOrder")
    public AjaxResult editAfterAuditReciveOrder(@RequestBody BuyBackOrder buyBackOrder);

    /**
     * @return com.ruoyi.common.core.web.domain.AjaxResult
     * @description 根据采购退货单id完全出库 完全收款，则采购退货单执行完
     * @date 2024/11/9 上午10:51
     * @Param id:
     **/
    @GetMapping("/buyBackOrder/check/status/{id}")
    public AjaxResult checkStockPayStatus(@PathVariable("id") Integer id);

    /**
     * @return com.ruoyi.common.core.web.domain.AjaxResult
     * @description 根据采购退货单编号修改采购退货单
     * @date 2024/11/9 下午3:05
     * @Param buyBackOrder:
     **/
    @PostMapping("buyBackOrder/update/buyBackOrder/byOrderCode")
    public AjaxResult updateBuyBackOrderByOrderCode(@RequestBody BuyBackOrder buyBackOrder);

    /**
     * @return com.ruoyi.common.core.web.domain.AjaxResult
     * @description 根据采购退货单编号和采购退货详情商品id修改采购退货详情
     * @date 2024/11/11 下午2:16
     * @Param buyBackOrderDetail:
     **/
    @PostMapping("/buyBackOrder/update/buyBackOrderDetail/byOrderIdGoodsId")
    public AjaxResult updateBuyBackOrderDetailByOrderIdGoodsId(@RequestBody BuyBackOrderDetail buyBackOrderDetail);

    /**
     * @return com.ruoyi.common.core.domain.R<com.ruoyi.system.api.domain.caigou.BuyBackOrderDetail>
     * @description 根据采购退货单id和商品id获取采购退货单详情
     * @date 2024/11/14 上午10:51
     * @Param buyBackOrderDetail:
     **/
    @PostMapping("/buyBackOrder/info/buyBackOrderDetail/byOrderIdGoodsId")
    public R<BuyBackOrderDetail> getBuyBackOrderDetailByOrderIdGoodsId(@RequestBody BuyBackOrderDetail buyBackOrderDetail);
}
